package org.boulderfoodrescue.webapp.client.old.viewer;

import org.boulderfoodrescue.webapp.client.TabPanel;
import org.boulderfoodrescue.webapp.client.googlemap.GoogleMap;
import org.boulderfoodrescue.webapp.client.old.calendar.ical.iCalCalendarPanel;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.ScrollPanel;

public class Viewer extends DockLayoutPanel implements TabPanel{
  protected SideBar sideBar;
  protected GoogleMap gMap;
  protected iCalCalendarPanel iCal;
  public Viewer() {
    super(Unit.PX);
    gMap = new GoogleMap();
    sideBar = new SideBar(gMap);
    ScrollPanel sPanel = new ScrollPanel(sideBar);
    this.addWest(sPanel, 380);
    this.add(gMap);
    iCal = new iCalCalendarPanel();
  }
  public void swtichToCalendarView(){
    this.remove(gMap);
    this.add(iCal);
  }
  public void switchToMapView(){
    this.remove(iCal);
    this.add(gMap);
  }
  @Override
  public void resized() {
//    gMap.resize();
  }
  public SideBar getSideBar() {
    return sideBar;
  }
  public GoogleMap getgMap() {
    return gMap;
  }
}
